/* global axios */
import ApiClient from '../ApiClient'

class FBChannel extends ApiClient {
  constructor () {
    super('facebook_indicators', { accountScoped: true })
  }

  create (params) {
    return axios.post(
      `${this.url.replace(this.resource, '')}callbacks/registerFacebookPage`,
      params
    )
  }

  reauthorizeFacebookPage ({ omniauthToken, inboxId }) {
    return axios.post(`${this.baseUrl()}/callbacks/reauthorizePage`, {
      omniauthToken: omniauthToken,
      inboxId: inboxId,
    })
  }
}

export default new FBChannel()
